import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class LRadiusButton extends StatefulWidget {
  final EdgeInsetsGeometry padding;
  final color;
  final BorderRadiusGeometry borderRadius;
  final text;
  final TextStyle textStyle;
  final GestureTapCallback onTap;
  final width;
  final height;

  LRadiusButton(
      {this.padding,
      this.color,
      this.borderRadius,
      this.textStyle,
      this.width,
      this.height,
      this.onTap,
      this.text});

  @override
  State<StatefulWidget> createState() {
    return _LRadiusButton();
  }
}

class _LRadiusButton extends State<LRadiusButton> {
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: widget.padding ?? EdgeInsets.all(0),
      child: Material(
        color: widget.color ?? Colors.grey,
        borderRadius: widget.borderRadius ?? BorderRadius.circular(0),
        child: Ink(
          decoration: BoxDecoration(
            color: widget.color ?? Colors.grey,
            borderRadius: widget.borderRadius ?? BorderRadius.circular(0),
          ),
          child: InkWell(
            onTap: widget.onTap ??
                () {
                  print("onTap");
                },
            borderRadius: widget.borderRadius ?? BorderRadius.circular(0),
            child: Container(
              width: widget.width ?? 100,
              height: widget.height ?? 30,
              child: Center(
                  child: Text(
                widget.text,
                style: widget.textStyle ?? TextStyle(color: Colors.white),
              )),
            ),
          ),
        ),
      ),
    );
  }
}
